﻿<phone:PhoneApplicationPage 
    x:Class="GeoFinderClientApp.View.ApplicationsMain"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:my="clr-namespace:GeoFinderClientApp.View.UserControls"
    xmlns:map="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
    xmlns:mapLayer="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"
    xmlns:block="clr-namespace:GeoFinderClientApp.Utils.Blocking"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    x:Name="ApplicationPage"
    >

    <UserControl.Resources>
        <SolidColorBrush x:Key="WhiteBrush" Color="White"/>
        <Path x:Key="path" Data="M 0,0 L 50,0 50,50 25,80 0,50 0,0" Fill="Red" Stroke="Wheat" StrokeThickness="2" />
    </UserControl.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="GeoFinder" x:Name="PivotController" SelectionChanged="PivotController_SelectionChanged">
            <!-- Pivot item zero-->
            <controls:PivotItem Header="Overall">
                <Grid>
                    <TextBlock HorizontalAlignment="Left" Margin="8,42,0,0" TextWrapping="Wrap" Text="Friends" VerticalAlignment="Top" RenderTransformOrigin="-0.238,-0.074" Width="139" FontSize="40"/>
                    <TextBlock Height="44" Margin="195,51,166,0" Name="WhiteListed" VerticalAlignment="Top" Text="{Binding Path=Count, Mode=OneWay}" FontSize="32" />
                    <TextBlock x:Name="label0" Margin="135,51,-3,0" TextWrapping="Wrap" Text="out of" VerticalAlignment="Top" Height="44" TextAlignment="Center" FontSize="32"/>
                    <TextBlock Height="44" HorizontalAlignment="Left" Margin="361,51,0,0" Name="TotalFriends" Text="{Binding Path=Count, Mode=OneWay}" VerticalAlignment="Top" Width="95" FontSize="32" />
                    <TextBlock Margin="8,247,0,233" TextWrapping="Wrap" Text="Near Friends" HorizontalAlignment="Left" Width="139" FontSize="40"/>
                    <TextBlock Height="55" Margin="195,247,154,0" Name="NearFriends" Text="{Binding Path=Count, Mode=OneWay}" VerticalAlignment="Top" FontSize="32" />
                    <TextBlock x:Name="label3" Margin="135,247,0,0" TextWrapping="Wrap" Text="out of" VerticalAlignment="Top" Height="55" TextAlignment="Center" FontSize="32"/>
                    <TextBlock Height="55" HorizontalAlignment="Left" Margin="361,247,0,0" Name="WhiteListed2" Text="{Binding Path=Count, Mode=OneWay}" VerticalAlignment="Top" Width="95" FontSize="32" />
                    <TextBlock HorizontalAlignment="Left" Margin="4,416,0,8" TextWrapping="Wrap" Width="143" FontSize="40"><Run Text="My position"/><LineBreak/><Run/></TextBlock>
                    <TextBlock x:Name="PositionBox" Margin="151,416,8,0" TextWrapping="Wrap" VerticalAlignment="Top" TextAlignment="Center" Height="111" FontSize="24" />
                </Grid>
            </controls:PivotItem>

            <!--Pivot item one-->
            <controls:PivotItem Header="Map">
                <Grid>
                    <mapLayer:Map block:BlocksPan.IsEnabled="True"  AnimationLevel="Full" CopyrightVisibility="Collapsed" x:Name="map" CredentialsProvider="AtBublODiDkhNAye719S7YhMio-aXvT9TwCNRrsdUuduXqRFOrju83h9n_pI0njn">
                       
                        <mapLayer:MapLayer x:Name="SearchingArea"/>
                        <Canvas Width="50"  Height="80" Name="nipple" mapLayer:MapLayer.Position="47.620574,-122.34942" mapLayer:MapLayer.PositionOrigin="BottomCenter" Opacity="0.7">
                            <Path Data="M 0,0 L 50,0 50,50 25,80 0,50 0,0" Fill="Red" Stroke="Wheat" StrokeThickness="2" />
                            <TextBlock FontSize="15" Foreground="White" Margin="15" TextAlignment="Center" Text="ME"/>
                        </Canvas>
                        <mapLayer:MapLayer x:Name="MapOther"></mapLayer:MapLayer>
                    </mapLayer:Map>



                    <!--<map:Map block:BlocksPan.IsEnabled="True" CopyrightVisibility="Collapsed" x:Name="map" CredentialsProvider="AtBublODiDkhNAye719S7YhMio-aXvT9TwCNRrsdUuduXqRFOrju83h9n_pI0njn">
                        <map:MapLayer>
                            <map:MapLayer>
                                <map:Pushpin x:Name="myLocation"/>
                            </map:MapLayer>-->

                           <!-- <Canvas Width="50"  Height="80" mapLayer:MapLayer.Position="47.620574,-122.34942" mapLayer:MapLayer.PositionOrigin="BottomCenter" Opacity="0.7">
                                <Path Data="M 0,0 L 50,0 50,50 25,80 0,50 0,0" Fill="Red" Stroke="Wheat" StrokeThickness="2" />
                                <TextBlock FontSize="10" Foreground="White" Margin="5" TextAlignment="Center">

                        ME <LineBreak />
                                </TextBlock>
                            </Canvas> </map:MapLayer>
                    </map:Map>-->
                    
                </Grid>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="All Friends">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="75"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Button Content="Manage Friends" Height="75" Grid.Row="0" Name="ManageFriends" HorizontalAlignment="Stretch" VerticalAlignment="Top" Click="ManageFriends_Click"/>
                    <my:AllFriendsControl x:Name="FL" Grid.Row="1"/>
                </Grid>
            </controls:PivotItem>
            
        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar x:Name="Bar" IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="ZoomIn_button" IconUri="/Icons/ZoomIn.png" Text="ZoomIn" Click="ZoomIn_button_Click"/>
            <shell:ApplicationBarIconButton x:Name="ZoomOut_button" IconUri="/Icons/ZoomOut.png" Text="ZoomOut" Click="ZoomOut_button_Click"/>
            <shell:ApplicationBarIconButton x:Name="Refresh_button" IconUri="/Icons/Refresh.png" Text="Refresh connections" Click="Refresh_button_Click"/>
            <shell:ApplicationBarIconButton x:Name="Settings_button" IconUri="/Icons/Settings.png" Text="Settings" Click="Settings_button_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="Aerial" Text="Aerial Mode" Click="Aerial_Click"/>
                <shell:ApplicationBarMenuItem x:Name="Road" Text="Road Mode" Click="Road_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
    
</phone:PhoneApplicationPage>